;; Basic rewriting.

(define R (make-argument-rewriter 'R '((a 1) (b 2) (c 3))))

(map R '(()
	 (5)
	 (5 6)
	 (5 6 7)
	 (5 6 c: 5)
	 (b: 6 a: 5 c: 7)))		

;; => ((1 2 3) (5 2 3) (5 6 3) (5 6 7) (5 6 5) (5 6 7))

(R '(5 6 7 8))				; => ERROR, Too many inputs

(R '(d: 4))				; => ERROR, Illegal keyword || (1 2 3)

(R '(1 2 b: 3))				; => ERROR, Illegal keyword || (1 2 3)

(R '(1 c: -1))				; => (1 2 -1)

(set! R (make-argument-rewriter 'R '((ppm 60) (pulse 0) (time #f) (lock #f))))

(R '(60))				; => (60 0 #f #f)

(set! R (make-argument-rewriter 'R '((value #f) (port #f))))

(R (list "t" (current-output-port)))

(R '("t"))				; => ("t" #f)
